from tkinter import *

f = int(input('фигура: '))
x = int(input('смещение по x: '))
y = int(input('смещение по y: '))
n = int(input('масштаб: '))

coords = [0*n+x, 0*n+y, 10*n+x, 0*n+y, 10*n+x, 10*n+y, 20*n+x, 10*n+y, 20*n+x, 20*n+y, 10*n+x, 20*n+y, 10*n+x, 30*n+y, 0*n+x, 30*n+y]
coords1 = [0*n+x, 0*n+y, 10*n+x, 0*n+y, 10*n+x, 10*n+y, 20*n+x, 10*n+y, 20*n+x, 0*n+y, 30*n+x, 0*n+y, 30*n+x, 20*n+y, 0*n+x, 20*n+y]
coords2 = [0*n+x, 0*n+y, 10*n+x, 0*n+y, 10*n+x, 10*n+y, 20*n+x, 10*n+y, 20*n+x, 30*n+y, 10*n+x, 30*n+y, 10*n+x, 20*n+y, 0*n+x, 20*n+y]

if n == 0 and x>=0 and x<=500 and y>=0 and y<=500:
    pass
else:
    if n > 0 and 0*n+x>=0 and 0*n+y>=0 and 20*n+x<=500 and 30*n+y<=500:
        pass
    else:
        if n < 0 and 20*n+x>=0 and 20*n+y>=0 and 0*n+x<=500 and 0*n+y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title("IT марафон")
root.geometry("500x500")

canvas= Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

if f == 1:
    canvas.create_polygon(coords)
elif f == 2:
    canvas.create_polygon(coords1)
elif f == 3:
    canvas.create_polygon(coords2)

root.mainloop()


